//
//  AddDeliveryOneCell.m
//  cityStar
//
//  Created by joyban on 14-12-29.
//  Copyright (c) 2014年 tiny. All rights reserved.
//

#import "AddDeliveryOneCell.h"
#import "UIColor+FlatUI.h"

@implementation AddDeliveryOneCell

+(CGFloat)heightOfTableCell
{
    return 307;
}

-(void)configWithViewControllr:(UIViewController *)viewController
{
    self.viewController = viewController;
}

- (void)awakeFromNib {
    UIColor *color = [UIColor colorFromHexCode:@"c4c4c4"];

    self.NameTextFiled.attributedPlaceholder = [[NSAttributedString alloc]initWithString:@"收货人姓名" attributes:@{NSForegroundColorAttributeName:color}];
    self.NameTextFiled.returnKeyType = UIReturnKeyDone;
    self.NameTextFiled.delegate = self;
    self.PhoneTextFiled.attributedPlaceholder = [[NSAttributedString alloc]initWithString:@"联系电话" attributes:@{NSForegroundColorAttributeName:color}];
    self.PhoneTextFiled.returnKeyType = UIReturnKeyDone;
    self.PhoneTextFiled.delegate = self;
    self.telPhoneTextFiled.attributedPlaceholder = [[NSAttributedString alloc]initWithString:@"手机号码" attributes:@{NSForegroundColorAttributeName:color}];
    self.telPhoneTextFiled.returnKeyType = UIReturnKeyDone;
    self.telPhoneTextFiled.delegate = self;
    self.OfficeTextField.attributedPlaceholder = [[NSAttributedString alloc]initWithString:@"邮政编码" attributes:@{NSForegroundColorAttributeName:color}];
    self.OfficeTextField.returnKeyType = UIReturnKeyDone;
    self.OfficeTextField.delegate = self;
    self.ardessTextField.attributedPlaceholder = [[NSAttributedString alloc]initWithString:@"详细地址" attributes:@{NSForegroundColorAttributeName:color}];
    self.ardessTextField.returnKeyType = UIReturnKeyDone;
    self.ardessTextField.delegate = self;
//    self.shenTextFiled.inputView = self.locatePicker;
//    self.shenTextFiled.enabled = NO;
    self.shenTextFiled.delegate = self;
}
- (IBAction)shen_Action:(UIButton *)sender {
    [self dismistokey];
    [self.delegate senderdidshen:sender];
}

-(void)textFieldDidBeginEditing:(UITextField *)textField
{
//    if ([textField isEqual:self.shenTextFiled]) {
//        [textField resignFirstResponder];
//        [self cancelLocatePicker];
//        self.locatePicker = [[HZAreaPickerView alloc] initWithStyle:HZAreaPickerWithStateAndCityAndDistrict delegate:self];
//        [self.locatePicker showInView:self.viewController.view];
//    }
}

-(void)dismistokey
{
    [self.NameTextFiled resignFirstResponder];
    [self.PhoneTextFiled resignFirstResponder];
    [self.telPhoneTextFiled resignFirstResponder];
    [self.OfficeTextField resignFirstResponder];
    [self.ardessTextField resignFirstResponder];
}

-(void)textFieldDidEndEditing:(UITextField *)textField
{
    [textField resignFirstResponder];
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
}

#pragma mark - TextField delegate
//- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
//{
//            [self cancelLocatePicker];
//}
//            self.locatePicker = [[HZAreaPickerView alloc] initWithStyle:HZAreaPickerWithStateAndCityAndDistrict delegate:self];
//            [self.locatePicker showInView:self.view];
//}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
